<?php
//require_once ("../common/DbOperation.php");
//$db=new DbOperation();
//echo json_encode($db->selectList("select *from lee_usersinfo"));
//require_once ("../public/Information.php");
//$info=new Information();
//echo json_encode($info->getSystemInfo());
define("APP_PATH", "D:/PhpstormProjects/star_horst_cms/");
$_SERVER['DOCUMENT_ROOT'] = "D:/PhpstormProjects/star_horst_cms/";
require_once("../public/Information.php");
require_once("../common/ImageOperation.php");
require_once("../common/DbOperation.php");
require_once("../public/Admin.php");
//require_once ("../common/HtmlOperation.php");
//$information=new Information();
//$sysInfo=$information->getSystemInfo();
//$htmlOperation=new HtmlOperation();
//$htmlOperation->html($sysInfo,"index.php","index.html");
//测试图片

//测试
//$file1 = 'D:/PhpstormProjects/star_horst_cms/assert/images/hangye.jpg';
//$path11 = '../upload/';
//$path12 = $path11.'thumb_width/';
//$path13 = $path11.'thumb_height/';
//$width1 = 400;
//$height1 = 240;
//
//$res=ImageOperation::fontMark($file1,$path11,5,20,20,array(0,0,0,50),"固定宽高式缩放图片保存成功");
//echo $res;
////测试固定宽高式缩放
//$res = ImageOperation::upload(array(
//    'file' => $file1,
//    'path' => $path11,
//    'width' => $width1,
//    'height' => $height1,
//));
//if (!$res) {
//    die(ImageOperation::$error);
//}
//echo "固定宽高式缩放图片保存成功：upload/{$res}<br>";
////测试固定宽度式缩放
//$res = ImageOperation::upload(array(
//    'file' => $file1,
//    'path' => $path12,
//    'width' => $width1,
//));
//if (!$res) {
//    die(ImageOperation::$error);
//}
//echo "固定宽度式缩放图片保存成功：thumb_width/{$res}<br>";
////测试固定高度式缩放
//$res = ImageOperation::upload(array(
//    'file' => $file1,
//    'path' => $path13,
//    'height' => $height1,
//));
//if (!$res) {
//    die(ImageOperation::$error);
//}
//echo "固定高度式缩放图片保存成功：thumb_height/{$res}<br>";
////测试图片裁剪
////$res = ImageOperation::crop($file1, $path11, 400, 400, 600, 200);
////if (!$res) {
////    die(ImageOperation::$error);
////}
//echo "裁剪图片保存成功：crop/{$res}<br>";
////测试图片水印
//$res = ImageOperation::watermark($file1, 'wechat.png', 'watermark/');
//if (!$res) {
//    die(ImageOperation::$error);
//}
//echo "水印图片保存成功：watermark/{$res}<br>";

//$admin=new Admin();
//$data=["user_name"=>"admin","password"=>md5("admin888"),"email"=>"l_1019@163.com","webchat"=>"lixy1019","phone"=>"13500556688","tel"=>"0831-2500388"];
//$admin->merge("id_admin",$data);


//$name="isDefaultName";
//$name1="xx_bb_cc_mm";
//echo toUnderScore($name)."\n";
//echo toCamelCase($name1);
//$inform = new Information();
//$redata = $inform->findByPage(1, 20);
//echo var_dump($redata);
$db=new DbOperation();
$fileName=$db->backup($_SERVER['DOCUMENT_ROOT']."backup/");
echo $fileName;
//$db->restore($fileName);